#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

int main()
{
	int arr[10] = { 8,3,1,6,7,8,3,1,4,0 };
	int i = 0;
	int n = sizeof(arr) / sizeof(int);
	for (i = 1; i < n; i++)
	{
		int emd = i-1;
		int tmp = arr[i];
		while (emd >= 0)
		{
			if (tmp> arr[emd])
			{
				arr[i] = arr[emd];
				arr[emd] = tmp;
				emd--;
				i--;
			}
			else
			{
				break;
			}
		}

	}
	for (int j = 0; j < n; j++)
	{
		printf("%d ", arr[j]);
	}
	return 0;
}